package com.heqiang.commons.exception;


import com.heqiang.commons.model.response.ResultCode;

/**
 * 自定义异常类型
 * @author Administrator
 * @version 1.0
 * @create 2018-09-14 17:28
 **/
public class CustomException extends RuntimeException {//因为RuntimeException是运行时异常,对代码没有侵入性

    //错误代码
    ResultCode resultCode;

    //构造方法
    public CustomException(ResultCode resultCode){
        this.resultCode = resultCode;
    }

    //通过调用此方法拿到错误代码
    public ResultCode getResultCode(){
        return resultCode;
    }


}
